package com.wyzt.item.web;

import com.wyzt.item.service.SpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("spec")
public class SpecificationController {

    @Autowired
    private SpecificationService specificationService;

    @GetMapping("{id}")
    public ResponseEntity<String> querySpecifications(@PathVariable("id") Long id) {
        return ResponseEntity.ok(specificationService.querySpecifications(id));
    }

    @GetMapping("cid")
    public ResponseEntity<String> querySpecificationsByCid(@RequestParam("cid") Long cid) {
        return ResponseEntity.ok(specificationService.querySpecifications(cid));
    }
}
